﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Compiler.TableOfSymbols.Types
{
    public abstract class BaseType : SymbolTableData
    {
        private string name;

        public string Name
        {
            get { return name; }
        }

        public BaseType(string name) 
            : base() 
        {
            if ((name == null) || (name == ""))
                throw new ArgumentOutOfRangeException("name can not be empty");
            this.name = name;
        }

        public abstract bool IsTypeVariable 
        { 
            get; 
        }
        public virtual bool IsTypeValue 
        {
            get { return !IsTypeVariable; }
        }

        protected override void _SetCategory()
        {
            this.category = SymbolTableDataCategory.TYPE;
        }

        public override string ToString()
        {
            return name;
        }
    }
}
